<!DOCTYPE html>
<html>
  <%
    var cdn = htmlWebpackPlugin.options.cdn || '',
        server = htmlWebpackPlugin.options.server,
        js = htmlWebpackPlugin.files.js,
        css = htmlWebpackPlugin.files.css;

  %>
  <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport"
      content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta http-equiv="X-UA-Compatible" content="IE=11,chrome=1" />
    <style>
      html,
      body {
        width: 100%;
        margin: 0;
        padding: 0;
      }
      .preview-wrap {
        width: 100%;
        min-height: 100vh;
        background: #F3F6FA;
        min-height: 100vh;
      }
      .preview-inner{
        width: 920px;
        overflow: hidden;
        margin: 0 auto;
      }
      @media all and (max-width: 700px) {
        .preview-inner {
          width: 100%;
        }
        .preview-inner #app {
          height: 100%;
          padding: 0;
        }
        .preview-inner  #app .item-label{
          color: #000000;
          font-weight: bold;
        }
        .el-message-box{
          width: 100%!important;
        }
      }
      #app {
        height: 100%;
        padding: 0 20px 30px;
        box-sizing: border-box;
      }
      #app .item-label{
        font-size: 15px;
        font-weight: bold;
      }

    </style>
    <link href="<%=cdn %>/static/ux/element-ui/index.css" rel="stylesheet">
    <link href="<%=cdn %>/static/fonts/font.css" rel="stylesheet">
    <script>
      //服务地址
      window.SERVER_URL = '<%=server %>';//服务地址
      window.CDN_URL = '<%=cdn %>';//cdn地址
    </script>
    <!-- 引入样式 -->
    <!-- 进行判断, 判断引入的是 cdn  -->
    <%for(var i=0;i<css.length;i++){var file = css[i]%>
    <link href="<%=file %>" rel="stylesheet">
    <%}%>
  </head>
  <body>

    <div class="preview-wrap">
        <div class="preview-inner">
          <form-preview id="app"> </form-preview>
    </div>
    </div>
  </body>
  <script src="<%=cdn %>/static/ux/vue/vue.min.js"></script>
  <script src="<%=cdn %>/static/ux/element-ui/index.js"></script>
  <!-- 引入js -->
  <%for(var i=0;i<js.length;i++){var file = js[i]%>
  <script src="<%=file %>"></script>
  <%}%>
  <script>
    var paramsStr = window.location.href.split("?")[1];
    let params = paramsStr.split("&");
    params = params.reduce((accu, str) => {
      let [key, value] = str.split("=");
      accu[key] = value;
      return accu;
    }, {});
    new Vue({
      el: "#app",
      data: function() {
        return {};
      },
      mounted() {
        this.$children[0].params = params;
      }
    });
  </script>
</html>
